<%--@elvariable id="page" type="com.dzzw.utils.Page"--%>
<%--
  Created by IntelliJ IDEA.
  User: 10391
  Date: 2021/4/28
  Time: 10:31
  To change this template use File | Settings | File Templates.
--%>
<%@page import="com.dzzw.Model.User"%>
<%@page language="java" import="com.dzzw.utils.Page" pageEncoding="UTF-8"%>
<%@ page import="java.util.List" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>查询用户信息</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
</head>

<%
    Page recordsPage = (Page) request.getAttribute("page");
    if (recordsPage == null) {
        request.getRequestDispatcher("/View/User/FindAllUserServlet").forward(request, response);
        return;
    }
%>

<body>
<div align="center" style="margin-top: 130px;">
    <h1 style="font-weight: bold;">用户信息列表</h1>
    <div align="left" style="width: 790px"><a  href="insert.jsp">添加请假记录</a></div>
        <table border="1" width="800px" style="text-align: center;">
                <tr>
                    <td>用户ID</td>
                    <td>用户账号</td>
                    <td>用户密码</td>
                    <td>用户昵称</td>
                    <td>用户姓名</td>
                    <td>用户身份证号</td>
                    <td>用户性别</td>
                    <td>用户年龄</td>
                    <td>用户邮箱</td>
                    <td>用户号码</td>
                    <td>用户地址</td>
                    <td>用户状态</td>
                </tr>
            <tbody>
            <c:forEach var="UserList" items="${requestScope.page.dataList}" varStatus="status">
                <tr height="30px" <c:if test="${status.index % 2 ==1}">style="background-color:#9CD1F3;"</c:if>>
                    <td>${UserList.user_id}</td>
                    <td>${UserList.user_actnumber}</td>
                    <td>${UserList.user_password}</td>
                    <td>${UserList.user_nickname}</td>
                    <td>${UserList.user_name}</td>
                    <td>${UserList.user_cardnumber}</td>
                    <td>${UserList.user_sex}</td>
                    <td>${UserList.user_age}</td>
                    <td>${UserList.user_phone}</td>
                    <td>${UserList.user_email}</td>
                    <td>${UserList.user_address}</td>
                    <td>${UserList.user_status}</td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    <div style="width: 800px;background-color: #9CD1F3;line-height: 40px;">
        <a href="FindAllUserServlet?pageIndex=1">首页</a>   
        <a href="FindAllUserServlet?pageIndex=${page.pageIndex-1<1?1:page.pageIndex-1 }">上一页</a>第${page.pageIndex }页/共${page.totalPageCount }页    
        <a href="FindAllUserServlet?pageIndex=${page.pageIndex+1>page.totalPageCount?page.pageIndex:page.pageIndex+1 }">下一页</a>  
        <a href="FindAllUserServlet?pageIndex=${page.totalPageCount }">末页</a>
        <div style="float: right; ">
            当前页<label for="select"></label>
        <select id="select" onchange="document.form1.submit();">
            <c:forEach begin="1" end="${page.totalPageCount}" var="pageNum">
                <option value="${pageNum}" ${page.pageIndex==pageNum?'selected="selected"':''}>${pageNum}</option>
            </c:forEach>
        </select>. 共${page.totalCount}条. 每页显示${page.pageSize}条    
        </div>
    </div>
</div>
</body>
</html>